Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] wgpu: Update bindings from v22.1.0.1 to v24.0.0.1 #4888

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

Valakor
Copy link
Contributor

@Valakor Valakor commented Feb 27, 2025

I'm marking this Draft because of a few design questions, and because I haven't yet figured out how to update wgpu.js properly.

Notable differences and things I'd like feedback on:

  • There are a handful of API-level bugs in the current release that have been fixed since the release of v24.0.0.1 that will need to be included in an official release before merging this PR. Currently the issues are with the return values of wgpuSurfacePresent, wgpuAdapterGetInfo, and wgpuSurfaceGetCapabilities.
  • Some API's in WGPU now effectively return a struct+WGPUStatus tuple. I've retained that behavior exactly, but Status only has the values Success and Error at the moment. This fits nicely with the (value, ok) return idiom in Odin if I were to translate the API values to bools instead, but would break if Status ever gains additional values.
  • API's no longer accept c-style strings, but instead a new StringView type. I've added some helpers (extra constants, creation functions, and a user formatter) that don't exist in the actual WGPU API but I wasn't sure what general policy was on API extras like these.
  • Still working on updating the existing examples.
  • I'm completely unfamiliar with JavaScript and WASM so I have yet to even attempt to update wgpu.js. Maybe @laytan has thoughts here? Some notable changes:
    • The new StringView type
    • Flags enums are now u64 instead of u32

@Valakor
Copy link
Contributor Author

Valakor commented Feb 27, 2025

Hah I had been working on this on and off for a bit and only noticed @laytan 's similar pull request in #4853... Maybe worth comparing to see if either of us have missed anything?

@laytan
Copy link
Collaborator

laytan commented Feb 28, 2025

Hey @Valakor, argh, always a pain when people do the same work at the same time...

We will be going with my PR for the update, mainly because it also updated wgpu.js. I do like that you've brought over doc comments. Although we do not really use the commenting conventions you used. Other than that the PRs look pretty similar.

If you have any suggestions or things you think were missed on my end please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants